<%@ page language="java" pageEncoding="utf-8" %>
<%@page import="java.util.ArrayList" %>
<%@page import="com.entity.GoodsEvaluate" %>
<%@page import="com.entity.GoodsType" %>
<%@page import="com.util.PublicToolShowDetailTypeList" %>
<%@page import="com.util.PublicToolGetTypeDetailInfo" %>
<%@page import="com.dao.GoodsTypeDetailInfoDAO" %>
<%@page import="com.entity.GoodsType" %>
<%@page import="com.entity.GoodsTypeDetail" %>
<%@page import="com.util.PublicToolCheckParam" %>
<%@page import="com.entity.SalesGoods" %>
<%@page import="com.util.PublicToolShowGooodsTypeList" %>
<%@page import="com.util.CheckCode" %>
<%
    String email = (String) session.getAttribute("email");
    String thirdemail = (String) session.getAttribute("thirdemail");
    String thirdName = (String) session.getAttribute("thirdName");

%>
<%
    String yzm = CheckCode.getCheckCode();
%>

<div class="boxtitlebg"> 用户登录</div>
<!-- 产品分类（列表） -->
<div class="productclass_dolphin">

<br>
    <%
        if (email == null) {%>
    <script type="text/javascript" src="js/web/loginOrRegister.js" charset="utf-8"></script>
    <form action="servlet/DoMethod?method=checkLogin" method="post" onsubmit="return checkLogin11()">
        <TABLE border="0" cellSpacing="0" cellPadding="0" width="100%"
               align="center">
            <DIV style="margin-left: 20px; float: left; display: none;" id="loginMsg" class="err-msg">
                 </DIV>
            <TBODY>
            <TR>
                <TD height="30" width="40%" align="right">用户名：</TD>
                <TD width="40%"><INPUT id="email" name="email" size="12" type="text" eMsg=""></TD>
                <TD width="30%" align="center">&nbsp;</TD>
            </TR>
            <TR>
                <TD height="30" align="right">密 码：</TD>
                <TD><INPUT id="pwd" type="password" name="pwd" tabIndex="2" size="12"></TD>
                <TD align="center">&nbsp;</TD>
            </TR>
            <TR>
                <TD height="30" align="right">验证码：</TD>
                <TD><input type="hidden" name="yzm" value="<%=yzm %>">
                    <INPUT class=input_new id=checkcode size=5 maxlength="4" name=checkcode onKeyUp="this.value=this.value.replace(/\D/gi,'')"> <%=yzm %>
                </TD>
                <TD align="center">&nbsp;</TD>
            </TR>
            <TR>
                <TD height="30" colSpan="3" align="center" style="padding-top:0px; cursor:hand;"><!-- <a href="#">登录说明</a>&nbsp;&nbsp; --><!-- <input type="submit" name="button" id="button" value=" 登录 "> -->
                    <%
                        String error = (String) request.getAttribute("error");
                        if (error != null) {
                            out.println("<font color='#FF0000' size='2'>" + error + "</font>");
                        }
                    %>
                    <input type="image" src="images/button_login.jpg" style="cursor: pointer;"/>

                    <br> <a href="web/lost.jsp">找回密码</a>
                    <a href='web/loginOrRegister.jsp'> 免费注册</a>
                </TD>
            </TR>
            </TBODY>
        </TABLE>
    </FORM>
    <% } else {

        //out.println(thirdName);%>
    <TABLE border="0" cellSpacing="0" cellPadding="0" width="100%"
           align="center">
        <DIV style="margin-left: 20px; float: left; display: none;" id="loginMsg" class="err-msg">
            <FONT style="font-size: 12px;">欢迎登录！</FONT></DIV>
        <TBODY>
        <TR>
            <TD height="30" align="center">

                <%
                    if (thirdName == null)
                        out.println("" + email + "&nbsp;&nbsp;<br>您好，欢迎光临! <br><a href='servlet/DoMethod?method=showMyInformation' >我的信息</a><br> <a href='servlet/DoMethod?method=loginOut' >退出</a>");
                %>
                <%
                    if (thirdName != null)
                        out.println("" + email + "&nbsp;&nbsp;<br>您好，欢迎光临在线! <br><a href='third/systemManage.jsp' >我的信息</a><br> <a href='servlet/DoMethod?method=loginOut' >退出</a>");
                %>

            </TD>
        </TR>

        </TBODY>
    </TABLE>

    <%
        }
    %>


</div><%--
<div class="boxtitlebg"> 科室列表</div>
<div style="font:12px/20px Verdana,microsoft yahei,Arial;color:#505050;padding:15px 10px 0px 20px">


    <% ArrayList<GoodsType> goodsTypeList = (ArrayList<GoodsType>) request.getAttribute("goodsTypeList");
        if (goodsTypeList == null || goodsTypeList.toString().equals("[]")) {
            out.println("<td colspan='5' height='30'><div align='center'>当前无任何科室!</div></td>");
        } else {
            for (int i = 0; i < goodsTypeList.size(); i++) {
                GoodsType gt = goodsTypeList.get(i);
                String typeName = gt.getTypeName();
    %>
    <h3><%=typeName%>
    </h3>

    <%


        PublicToolShowDetailTypeList.showDetailallTypeList(request, response, gt.getTypeId());

        ArrayList<GoodsTypeDetail> goodsTypeList1 = (ArrayList<GoodsTypeDetail>) request.getAttribute("goodsDetailallTypeList");
        if (goodsTypeList1 == null || goodsTypeList1.toString().equals("[]")) {
            out.println("<div align='center'>当前无任何科室信息!</td>");
        } else {
            for (int ii = 0; ii < goodsTypeList1.size(); ii++) {
                GoodsTypeDetail gt1 = goodsTypeList1.get(ii);
                String typeName1 = gt1.getTypeDetailInfo();
                int Id = gt1.getId();
    %>
    <a href="servlet/typelist?typeid=<%=Id%>"><%=typeName1%>
    </a>
    <%
            }
        }
    %>

    <% }


    }
    %>


</div>--%>

